module SRI
  class Conditional < Expression
    attr_accessor :cond, :e1, :e2
    def initialize( cond, e1, e2 )
      @cond = cond
      @e1 = e1
      @e2 = e2
    end
  
    def to_s
      "if( #{cond} ) {\n  #{e1}\n} else {\n  #{e2}\n}"
    end
  end

  def If( cond, e1, e2 )
    Conditional.new( cond, e1, e2 )
  end
end
